[C#] SQLite - Creating and changing databases on the fly
Posted
by Oskar Kjellin
on Stack Overflow
See other posts from Stack Overflow
or by Oskar Kjellin
Published on 2010-04-15T16:00:56Z
Indexed on
2010/04/15
16:03 UTC
Read the original article
Hit count: 434
Today I use SQLite and send a database-file with the project.
However I want the database to be created when the user first starts the software.
Is there a way to copy the code needed to create a database based on the existing database? The problem is that when a user downloads a new version he might be tricked into copying over his last database and lose the data. I'd like a nice way to check the version of the database and modify it if I need new columns or tables etc. Or, if it does not exist at all, create a new database?
I know I can probably make create the code to make the database from the beginning but I want it to be based on the existing database I have created by a gui.
© Stack Overflow or respective owner